package com.vb.scrum.client;

public class Utility {
	private int screenWidth;
	private int screenHeight;
	private int offsetHeight;
	
	private int mainPanelHeight;
	private int mainPanelWidth;
	private int topPanelWidth;
	private int topPanelHeight=25;
	private int buffer10=10;
	private int subStatePanelHeight;
	private int subStatePanel1_width;
	private int subStatePanel2_width;
	private int subStatePanel3_width;	
	
	/*
	 * All things required before loading application to be processed in constructor, may contain various kinds of ops 
	 * */
	public Utility(){		
		//Screen size related operations		
		screenHeight=JSUtility.getScreenHeight();
		screenWidth=JSUtility.getScreenWidth();
		//offsetHeight=JSUtility.getOffsetHeight();
		topPanelWidth=screenWidth-buffer10;
		mainPanelHeight=screenHeight-topPanelHeight-buffer10;
		mainPanelWidth=screenWidth-buffer10;		
		subStatePanelHeight=mainPanelHeight-buffer10;
		subStatePanel1_width=screenWidth/2;
		subStatePanel2_width=screenWidth*27/100;
		subStatePanel3_width=screenWidth*22/100;
		
	}	
	/*Utility to convert from int to pixels i.e. 100 to "100px"
	 * */
	public String convertToPixels(int value){
		return value+"px";
	}	
	public String getTopPanelWidth(){return convertToPixels(topPanelWidth); }
	public String getTopPanelHeight(){return convertToPixels(topPanelHeight); }
	public String getMainPanelWidth(){return convertToPixels(mainPanelWidth); }
	public String getMainPanelHeight(){return convertToPixels(mainPanelHeight); }
	
	public String getSubStatePanelHeight(){return convertToPixels(subStatePanelHeight); }
	public String getSubStatePanel1_width(){return convertToPixels(subStatePanel1_width); }
	public String getSubStatePanel2_width(){return convertToPixels(subStatePanel2_width); }
	public String getSubStatePanel3_width(){return convertToPixels(subStatePanel3_width); }
}
